<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <title>我的宠物</title>
  <meta name="renderer" content="webkit">
  <meta name="force-rendering" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge">
  <meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0, user-scalable=no">
  <link rel="stylesheet" type="text/css" href="#(CPATH)/_view/static/css/common.css">
  <link rel="stylesheet" type="text/css" href="#(CPATH)/_view/static/css/center.css">
  <link rel="stylesheet" type="text/css" href="#(CPATH)/_view/static/layer_mobile/need/layer.css">
  <link rel="stylesheet" type="text/css" href="#(CPATH)/_view/static/css/newLook.css">
  <script type="text/javascript" src="#(CPATH)/_view/static/js/jquery.min.js"></script>
  <script type="text/javascript" src="#(CPATH)/_view/static/js/fontRem.js"></script>
  <script type="text/javascript" src="#(CPATH)/_view/static/js/common.js"></script>
  <script type="text/javascript" src="#(CPATH)/_view/static/layer_mobile/layer.js"></script>
  <link rel="stylesheet" href="#(CPATH)/_view/static/layui/css/layui.css"  media="all">
</head>
<body>
<!--头部开始-->

<!--头部结束-->


<div class="bigMain">
  <div class="mainContent">
    #if(list.size() > 0 )
	    #for(x : list)
	    <div class="listWrap">
	        <div class="houseIterm clearfix">
	        
	          <img src="#(CPATH)/#(cn.samehope.pet.engine.PicEngine::getPic(x.pic??'', x.category??'') )" class="coverPic">
	          <div class="mainInfoBox">
	              <div class="box clearfix" style="margin-bottom: 0px;">
	                <span class="titleName">#(x.name)</span>
	              </div>
	              <div class="box clearfix" style="margin-bottom: 0px;">
	                <span><i class="fs26-aaa">品种</i><i class="fs26-222 infoRight">#(x.breed??'')</i></span>
	              </div>
	              <div class="box clearfix" style="margin-bottom: 0px;">
	                <span><i class="fs26-aaa">生日</i><i class="fs26-222 infoRight">#date(x.birthday, "yyyy-MM-dd")</i></span>
	              </div>
	              <div class="box clearfix txt-right" name="#(x.id)">
	                 <span class="commonBtn del" onclick="edit('#(x.id)');">编辑</span>
	                 <span class="commonBtn  blueBtn" onclick="record('#(x.id)')">成长记录</span>
	              </div>
	          </div>
	        </div>
	        </div>
	    #end
	#else
		<fieldset class="layui-elem-field layui-field-title" >
			<legend align="center">请先添加自己的宠物</legend>
		</fieldset>
    #end     
        
    
  </div>
</div>
<div class="telPhoneWrap"><a href="javascript:add()" class="icon-16 telPhone"></a></div>
</body>
<script type="text/javascript">
 function del(id){
	 
    	layer.open({
		    content: '是否删除此条数据'
		    ,btn: ['删除', '取消']
		    ,skin: 'footer'
		    ,yes: function(index){

		    	$.ajax({
					type : "post",
					url : "#(CPATH)/animal/del",
					dataType : "JSON",
					async: false,
					data : {
						"id" : id
					},
					success : function(data) {
						if(data.state=='ok'){
							layer.open({
					    	    content: '删除成功'
					    	    ,skin: 'msg'
					    	    ,time: 2 //2秒后自动关闭
					    	    ,end: function () {
					    	    	window.location.href = 'http://layer.layui.com/';
					            }
					    	  });
						}else{
							//提示
							layer.open({
					    	    content: '删除失败'
					    	    ,skin: 'msg'
					    	    ,time: 2 //2秒后自动关闭
					    	  });
						}
					},
					error : function() {
					}
				});
		    }
		  });
 }
 
 function add(){
	 window.location.href = '#(CPATH)/animal/forward';
 }
 
 function edit(id){
	 window.location.href = '#(CPATH)/animal/forward?id=' + id;
 }
 
 function record(id){
	 window.location.href = '#(CPATH)/animalRecord?animal_id=' + id;
 }
</script>
</html>